* keyboard.c (parse_modifiers, apply_modifiers): Make sure we're
authorJim Blandy <jimb@redhat.com>
Wed, 31 Mar 1993 07:19:25 +0000 (07:19 +0000)
committerJim Blandy <jimb@redhat.com>
Wed, 31 Mar 1993 07:19:25 +0000 (07:19 +0000)
not trying to create modifier masks using integers which are
unrepresentable as lisp values.

src/keyboard.c

index d80cf2d83e8f7bb0a67ab57134f34560d9cdd73f..91e4ee1f4770bf59249a7cad0bd7a99da941dfe6 100644 (file)
@@ -2485,6 +2485,8 @@ parse_modifiers (symbol)
                   Qnil);
       Lisp_Object mask;
 
+      if (modifiers & ~((1<<VALBITS) - 1))
+       abort ();
       XFASTINT (mask) = modifiers;
       elements = Fcons (unmodified, Fcons (mask, Qnil));
 
@@ -2521,6 +2523,8 @@ apply_modifiers (modifiers, base)
 
   /* The click modifier never figures into cache indices.  */
   cache = Fget (base, Qmodifier_cache);
+  if (index & ~((1<<VALBITS) - 1))
+    abort ();
   XFASTINT (index) = (modifiers & ~click_modifier);
   entry = Fassq (index, cache);
 
@@ -2538,6 +2542,8 @@ apply_modifiers (modifiers, base)
       Fput (base, Qmodifier_cache, Fcons (entry, cache));
 
       /* We have the parsing info now for free, so add it to the caches.  */
+      if (modifiers & ~((1<<VALBITS) - 1))
+       abort ();
       XFASTINT (index) = modifiers;
       Fput (new_symbol, Qevent_symbol_element_mask,
            Fcons (base, Fcons (index, Qnil)));